<template>
  <div class="services-container">

    <div class="services-layout">
      <!-- 内容展示 -->
      <div class="service-content">
        <div v-if="ServiceNeedData"
             class="content-wrapper">
          <h3 class="content-title">{{ ServiceNeedData.title }}</h3>
          <div class="content-desc" v-html="ServiceNeedData.description"></div>
        </div>
        <div v-else class="empty-content">
          {{$t('contentDetails.loading')}}
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    ServiceNeedData: {
      type: Object,
      default: () => {}
    }
  },
  computed: {
    baseUrl() {
      return process.env.VUE_APP_BASE_API
    }
  },
  methods: {

  }
}
</script>



<style scoped lang="scss">
/* 基础样式保持不变 */
.services-container {
  max-width: 1200px;
  margin: 80px auto 0;
  padding: 0 20px;
}

.services-layout {
  margin-top: 40px;
  overflow: hidden;
}

.services-list {
  display: flex;
  justify-content: space-between;
  padding: 0;
  margin: 0;
  list-style: none;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  user-select: none;
  cursor: pointer;

  .service-item {
    flex: 1;
    padding: 20px;
    text-align: center;
    background-color: #eeeeee;
    border-right: 1px solid #e0e0e0;
    transition: all 0.3s ease;

    &:last-child {
      border-right: none;
    }

    &.active {
      background-color: #fe3231;
      color: #fff;
      border-right-color: #c72c2c;
      .service-title, .service-en-title {
        color: #fff;
      }
    }
  }
}

.service-en-title {
  font-size: 14px;
  color: #666;
}

.service-content {
  width: 100%;
  background: #fff;
  padding: 20px;
  min-height: 400px;
  position: relative;
}

.content-wrapper {
  animation: fadeIn 0.5s ease;
  padding: 16px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.content-title {
  font-size: 24px;
  font-weight: 550;
  color: #333;
  margin-bottom: 40px;
  padding-bottom: 10px;
  text-align: center;
}

.content-desc {
  font-size: 16px;
  line-height: 1.8;
  color: #666;
}

/* ======== 移动端适配 ======== */

@media (max-width: 992px) {
  .services-container {
    margin-top: 60px;
  }

  .services-layout {
    margin-top: 30px;
  }

  .content-title {
    font-size: 22px;
    margin-bottom: 30px;
  }

  .content-desc {
    font-size: 15px;
    line-height: 1.7;
  }

  .service-item {
    padding: 15px 10px !important;
  }

  .service-en-title {
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .services-container {
    margin-top: 40px;
    padding: 0px;
  }

  .services-layout {
    margin-top: 20px;
  }

  .services-list {
    flex-direction: column; /* 改为垂直布局 */
    border: none;
  }

  .service-item {
    margin-bottom: 10px;
    border: 1px solid #dcdcdc !important; /* 添加独立边框 */
    border-radius: 6px; /* 添加圆角 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* 添加微妙阴影 */

    &:last-child {
      margin-bottom: 0;
    }

    &.active {
      box-shadow: 0 3px 8px rgba(254, 50, 49, 0.3); /* 激活状态更强阴影 */
    }
  }

  .service-content {
    padding: 5px;
    min-height: 300px;
  }

  .content-wrapper {
    padding: 10px;
  }

  .content-title {
    font-size: 20px;
    margin-bottom: 25px;
  }

  .content-desc {
    font-size: 14px;
    line-height: 1.6;
  }

  .service-en-title {
    display: none; /* 在移动端隐藏英文标题以节省空间 */
  }
}

@media (max-width: 480px) {
  .services-container {
    margin-top: 30px;
  }

  .content-title {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 5px;
  }

  .content-desc {
    font-size: 13px;
    line-height: 1.6;
  }

  .service-item {
    padding: 12px !important;
  }

  .service-content {
    padding: 5px;
  }
}
</style>
